<template>
  <view class="router-view bcl-white">
    <!-- LOGO -->
    <view class="logo">
      <image class="block" src="/static/images/logo.png" mode="widthFix" />
    </view>

    <view class="text-center fz-16">志华网登录确认</view>
    <view class="cl-second fz-12 mt-5 text-center"
      >请不要扫描来源不明的二维码</view
    >

    <view class="mt-50 text-center pl-15 pr-15">
      <button class="uni-button uni-button-radius width" @tap="scanLogin">
        确认登录
      </button>

      <navigator
        open-type="navigateBack"
        target="view"
        class="cl-second mt-20 inline-block"
        >取消登录</navigator
      >
    </view>
  </view>
</template>

<script>
import { scanLogin } from "@/apis/user";

export default {

  data() {
    return {};
  },

  methods: {
    async scanLogin() {
      let { code } = await scanLogin();
      if (code === 200) {
        this.$toast("登录成功");
        setTimeout(() => {
          uni.navigateBack();
        }, 1000);
      }
    },
  },
};
</script>

<style lang="scss" scoped>
.router-view {
  .logo {
    image {
      width: 350upx;
      margin: 200upx auto;
    }
  }
  .uni-button {
    padding: 20upx 0;
  }
}
</style>
